﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Workbench.Models
{
    public class ParagraphModel : PersistableModel
    {
        public long FileId;
        public ProjectFileModel File;
        public int StartPosition;
        public int Length;
    }

    public class SentenceModel : PersistableModel
    {
        public long ParagraphId;
        public ParagraphModel Paragraph;
        public int StartPosition;
        public int Length;
    }

    public class WordModel : PersistableModel
    {
        public long SentenceId;
        private SentenceModel sentence;
        public SentenceModel Sentence
        {
            get { return sentence; }
            set { sentence = value; RaisePropertyChanged(); }
        }

        public long UniqueWordId;
        private UniqueWordModel uniqueWord;
        public UniqueWordModel UniqueWord
        {
            get { return uniqueWord; }
            set { uniqueWord = value; RaisePropertyChanged(); }
        }

        public long BaseFormId;
        private BaseFormModel baseForm;
        public BaseFormModel BaseForm
        {
            get { return baseForm; }
            set { baseForm = value; RaisePropertyChanged(); }
        }

        private ObservableCollection<POSTypeModel> posTypes = new ObservableCollection<POSTypeModel>();
        public ObservableCollection<POSTypeModel> POSTypes
        {
            get { return posTypes; }
        }

        public string GetContent()
        {
            return this.UniqueWord.Content;
        }

        public override string ToString()
        {
            return string.Format("Content={0}", GetContent());
        }
    }

    public class UniqueWordModel : PersistableModel
    {
        private string content;
        public string Content
        {
            get { return content; }
            set { content = value; RaisePropertyChanged(); }
        }
    }
}
